<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: l
  Date: 2023/6/23
  Time: 16:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>订单详情</title>
</head>
<link rel="stylesheet" href="css/base.css">
<link rel="stylesheet" href="css/order.css">
<script src="js/jquery.min.js"></script>
<script src="js/order.js"></script>

<body>
<div class="container">
    <div class="order">
        <div class="count">
            <div class="haven-sell">
                <img src="img/haven-sell.png" alt="">
                <p class="number">售卖 ${sole}</p>
            </div>
            <div class="my-buy">
                <img src="img/my-buy.png" alt="">
                <p class="number">购买 ${buy}</p>
            </div>
        </div>
        <div class="nav">
            <ul>
                <li class="active">售卖订单</li>
                <li>我的购买</li>
            </ul>
        </div>
        <!-- 内容切换 -->
        <div class="con">
            <!-- 售卖订单 -->
            <div class="con-item">
                <!-- 商品项 -->
                <c:forEach items="${mysole}" var="s">
                    <c:if test="${s.orderState != '4'}">
                <a href="/shang/shang_selectOrderInfo?id=${s.id}" class="product">
                    <img src="../upload/${s.photo}" alt="">
                    <div class="product-info">
                        <p class="product-name">${s.name}</p>
                        <div class="label">
                            <div class="district-server-label">${s.game}</div>
                            <div class="my-label">我的</div>
                        </div>
                        <div class="product-bot">
                            <p class="product-price">￥${s.price}</p>
                        </div>
                        <div class="from">
                            <p>@${s.username}</p>
                            <p class="haven-buy">
                                <c:if test="${s.orderState == '0'}">
                                    <form action="/shang/shang_updateOrderState" method="post">
                                        <input type="hidden" name="id" value="${s.id}">
                                        <input type="hidden" name="state" value="1">
                                        <input class="sun" style="background: #ee5f5b" type="submit" value="待确认">
                                    </form>
                                </c:if>
                                <c:if test="${s.orderState == '1'}">
                                    待买家支付
                                </c:if>
                                <c:if test="${s.orderState == '2'}">
                                    <form action="/shang/shang_updateOrderState" method="post">
                                        <input type="hidden" name="id" value="${s.id}">
                                        <input type="hidden" name="state" value="3">
                                        <input class="sun" style="background: #ee5f5b" type="submit" value="确认收款">
                                    </form>
                                </c:if>
                                <c:if test="${s.orderState == '3'}">
                                    完成
                                </c:if>
                            </p>
                        </div>
                    </div>
                </a>
                    </c:if>
                </c:forEach>
            </div>
            <!-- 我的购买 -->
            <div class="con-item" style="display: none;">
                <!-- 商品项 -->
                <c:forEach var="b" items="${mybuy}">
                    <c:if test="${b.orderState != '4'}">
                <a href="/shang/shang_selectOrderInfo?id=${b.id}" class="product">
                    <img src="../upload/${b.photo}" alt="">
                    <div class="product-info">
                        <p class="product-name">${b.name}</p>
                        <div class="label">
                            <div class="district-server-label">${b.game}</div>
                        </div>
                        <div class="product-bot">
                            <p class="product-price">￥${b.price}</p>
                        </div>
                        <div class="from">
                            <p>@${b.username}</p>
                            <p class="haven-buy">
                                <c:if test="${b.orderState == '0'}">
                                    待卖家确认
                                </c:if>
                                <c:if test="${b.orderState == '1'}">
                                    请支付
                                </c:if>
                                <c:if test="${b.orderState == '2'}">
                                    待确认收款
                                </c:if>
                                <c:if test="${b.orderState == '3'}">
                                    完成
                                </c:if>
                            </p>
                        </div>
                    </div>
                </a>
                    </c:if>
                </c:forEach>
            </div>
        </div>
    </div>
</div>
</body>
</html>
